Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support private module completions #16051

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

StephenWeatherford
Copy link
Contributor

@StephenWeatherford StephenWeatherford commented Jan 9, 2025

Fixes #9038

Microsoft Reviewers: Open in CodeFlow

@StephenWeatherford StephenWeatherford changed the title Support private module completions [WIP] Support private module completions Jan 9, 2025
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Test this change out locally with the following install scripts (Action run 13247859038)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 13247859038
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 13247859038"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 13247859038
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 13247859038"

Copy link
Contributor

github-actions bot commented Jan 9, 2025

Dotnet Test Results

    78 files   -     39      78 suites   - 39   35m 5s ⏱️ - 11m 2s
11 766 tests +    21  11 766 ✅ +    21  0 💤 ±0  0 ❌ ±0 
27 290 runs   - 13 538  27 290 ✅  - 13 538  0 💤 ±0  0 ❌ ±0 

Results for commit 41a8cac. ± Comparison against base commit 6fcb976.

This pull request removes 1840 and adds 692 tests. Note that renamed tests count towards both.

		nestedProp1: 1
		nestedProp2: 2
		prop1: true
		prop2: false
	1
	2
	\$'")
	prop1: true
	prop2: false
…
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��K
�0\u0010\u0006�=E�\u0001b�i���\u0008n<@lG��Z�
\u0005��\u000bq��\u000f�|��@&	��zo�-�\u0014��hn����QGKٻ�a� f�(�Fi�\u0010nG��ǽnl�F�c�\u001f�Cl�,��\u0019\u0011q�\u00157$4�r\u0015�\-\u0019��\u0008��9�Y�BK.���������
���tW�-�TH��\u0000ť\u0014B\u0019D������L�y�\u001f88\u0014Ж�4�� ?B\u0015l��^kx.=��y�7�\u0017��k�\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��K\u000e� \u0010\u0006`֞�\u0013Pf
\u000c.�w�\u0015�6�R�G��xw���E\u001b7�5�o�0a��"ٻ~��c^�� �D����(5�>\u0000
\u000c�E2IZ\u001b�x?�$#ںqU\u0018e��~\u0010Z�s�g@�\u0016\u00015��Ң\u0001�	��d
��5���W_v^\��\u000f
�T��\u0017�F��߷��S��D\u0006�4*���B�a��\u0017�����X{�(��h
O0�\u0005
\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��M\u000b�0\u0018\u0007��\u0014�\u000f0�>
<\u0004\u001d2��k�\u001cd��\u001a\u0008}��!�(]Ԃ�;n\u000f����A�N7+�SSVHR%}\u0004��-�y�z�p\u0005�z�\u0000+!\u0019\u0000�\u0019��\u000e��֥me��~\u0010
����DD��\u0012*�B\u0001	�������H\u0008o�>GY��\u0006]�kі�}�߾������=ѧ�cʁ�\u0001�rΘP\u0000K!m\u001e�$����?�89,6���o\u0013o\u000e�\u0004�vO��8���s)��\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003��K
�0\u0010\u0006�=EN�f&��.�w�\u0015�\u0016|�T��\u0005��\u000b�E���\u0008�[f\u0018f���do�]a�E�\u0008ED�`K�^����\u0008\u0008\u0018�\u0017ɤ!R��a�M&tMkk��\u001a�~\u0010n�m�e��Q\u0019\u0002*#\u0005�ԟ ���a�\u0006�f�S޹��z'.M�Ɔr�!�G�I���֌O��\u0012\u0019hC��\u0002D��P��J&�<��G�
�(��\u0010��驖\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003���
�@\u0010\u0000�=�\u0014�\u0003���f�!�\u0011\u0016\u0004]cɅ\u000c�P\u0003��o<D\u0017��?A�\u001dw\u0007f��\u0019��u�6:1E����èo\u0004�B��7�P��7���>Aȩ{��ţ�t\u0001����\u0007����43!U<`�qE�)"���ݹ�\u0006�]W�0�\u0013S�ky˛�+|�gZ\u001d>�7\�o�O�@�\u0003$\u0013�C� �C����2��>�O7���m�:m\u000e��]8����ɲ,�\u001a�\u000b�)�\\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003���\u000b� \u0014\u0007p��\u0015�?�t�t��]�.�\u0001��h���\u000c\u0006���;D��.�\u0011��\u000f�\u0013�J�{�n�dP7�K)�\u0004��:�\u0010��\u001d&\u0014b�"�dD\u0011�����7��n�9z��Pcc�\u0002\u0012�x\u001c��+F��R�l��ҡ=\u0016���s��\u0019����ʮ�\u0018*_��ހ��M��[�)\u0017��\u00012\u0014��g�h$e��Y2������PB[Aj!�Aq�:����6�\z6��<o:/Xn��\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.DecompilationTests ‑ Decompiler_handles_banned_function_replacement ("createArray(1, 2, 3)","array","[
  1
  2
  3
]")
Bicep.Core.IntegrationTests.DecompilationTests ‑ Decompiler_handles_banned_function_replacement ("createObject('key', 'value')","object","{
  key: 'value'
}")
Bicep.Core.IntegrationTests.DecompilationTests ‑ Decompiler_handles_strings_with_newlines ("
","\n")
Bicep.Core.IntegrationTests.DecompilationTests ‑ Decompiler_handles_strings_with_newlines ("
","\r\n")
…

♻️ This comment has been updated with latest results.

@StephenWeatherford StephenWeatherford force-pushed the sw/acr-completions branch 5 times, most recently from a447698 to 479ed50 Compare January 16, 2025 00:47
@StephenWeatherford StephenWeatherford force-pushed the sw/acr-completions branch 4 times, most recently from af65f40 to 5ea8c28 Compare January 24, 2025 18:56
@StephenWeatherford StephenWeatherford force-pushed the sw/acr-completions branch 3 times, most recently from d940471 to 704815e Compare January 31, 2025 00:42
@StephenWeatherford StephenWeatherford force-pushed the sw/acr-completions branch 7 times, most recently from 657444f to fef0f0e Compare February 5, 2025 23:56
@StephenWeatherford StephenWeatherford changed the title [WIP] Support private module completions Support private module completions Feb 5, 2025
/// <summary>
/// Provider to get metadata for modules stored in a public or private registry.
/// </summary>
public abstract class BaseModuleMetadataProvider(
Copy link
Contributor Author

@StephenWeatherford StephenWeatherford Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this code was simply moved from the old PublicModuleMetadataProvider, see below

@@ -39,33 +46,115 @@ private enum ModuleCompletionPriority
FullPath = 2, // br:, ts:
}
Copy link
Contributor Author

@StephenWeatherford StephenWeatherford Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code was quite complex. I rewrote large portions of it, combining the public and private cases in most places, and also combining the handling of aliased vs fully-qualified by moving all the parsing code to a single private class. A lot of code simply went away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support ACR (private) module reference completions
1 participant